<script setup lang="tsx">

// 接收 props
const props = defineProps<{
  type: "add" | "edit" | "input" | "delete" | 'export',
  text: string
}>();
const getIcon = (name: any) => {
  return new URL(`./img/${name}.png`, import.meta.url).href
}


</script>
<template>
  <div class="root-b">
    <img class="w-[12px] h-[12px]" :src="getIcon(props.type)" alt="">
    <span class="text-[14px] text-nowrap">{{ props.text }}</span>
  </div>

</template>

<style lang="less" scoped>
.root-b {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  cursor: pointer;

  &:hover {
    background: linear-gradient(0deg, #2d74d0, #1792fa);
    color: #fff;
  }
}
</style>